home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CDPD Public Domain Collection for CDTV 4
/
CDPD_IV.bin
/
e
/
mailinglists
/
amigae.0793july.archive
/
000103_crash!kirk.safb.af.mil!BWILLS_Thu, 29 Jul 93 07:44:44 PST.msg
< prev
next >
Wrap
Internet Message Format
|
1994-05-26
|
2KB
Received: by bkhouse.cts.com (V1.16/Amiga)
id AA00000; Thu, 29 Jul 93 07:44:44 PST
Received: from kirk.safb.af.mil by crash.cts.com with smtp
(Smail3.1.28.1 #15) id m0oLYtL-0000SqC; Thu, 29 Jul 93 07:23 PDT
Message-Id: <m0oLYtL-0000SqC@crash.cts.com>
Date: 29 Jul 93 09:21:00 CST
From: "Barry D. Wills" <BWILLS@kirk.safb.af.mil>
To: "amigae" <amigae@bkhouse.cts.com>
Subject: MidStr
Hi, Jeffrey. In response to your message:
> I can't get MidStr() to work right. It is reading it from the starting
>point right, but I can't get it to stop! I am trying to get a version string
>pulled out of a buffer I am getting from Read(). Before vtst was defined as a
>string, it was working somewhat well (I was getting what I wanted), but I am
>not sure whether it was stoping where I wanted. What I need is the original
>version string, with the revision number bumped up by one.
=======================================================================
PROC findver(pos) /* pos is found in the prior proc */
DEF endpos,
vers,
per,
vn,
vp,
vns,
nvers,
rvers,
vtst[80]:STRING
endpos:=InStr(filbuf,'\n',pos) /* finding then end of the line */
*******************************************************************************
*** Your problem starts here. vers is uninitialized, so it contains a value
*** that looks like an address. MidStr() copies characters to the nonexistent
*** string at "address" vers. You need to declare these as STRING or allocate
*** the using String(). Basically, this is copying characters into random
*** memory locations, a very effective way to corrupt your memory :( I noticed
*** this happening in several places in the code that follows this statement.
***
MidStr(vers,filbuf,pos,endpos-pos)
[statements removed]
*** StringF() still might work under lucky circumstances.
StringF(vtst,'\s \d.\d',nvers,vp,rvers)
*** As for your run-on problem, it may be a symptom of this. If it persists
*** then post, post again! :-)
Later.
-- Barry